import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    redirect: "/login"
  },
  {
    path: '/login',
    name: 'Login',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
  },
  {
    path: "/main",
    name: "Main",
    component:()=>import("../views/Main"),
    children:[
      {
        path:"/user/list",
        name:"UserList",
        component: ()=>import("../views/system/User.vue")
      },
      {
        path:"/role/list",
        name:"RoleList",
        component: ()=>import("../views/system/Role.vue")
      }
    ]


  },

]

const router = new VueRouter({
  routes
})

export default router
